
<%@ page import="com.walkingfiles.registry.Document" %>
<%@ page import="com.walkingfiles.registry.LogItem" %>
<%@ page import="com.walkingfiles.registry.File" %>

<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'document.label', default: 'Document')}" />
		<g:set var="logEntityName" value="${message(code: 'document.log.label', default: 'Document Log')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
	<div id="outer">
		<g:render template="/layouts/menu"/>
		<a href="#show-document" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div id="show-document" class="content scaffold-show" role="main">
			<h1><g:message code="default.show.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list document">
			
				<g:if test="${documentInstance?.number}">
				<li class="fieldcontain">
					<span id="number-label" class="property-label"><g:message code="document.number.label" default="Number" /></span>
					
						<span class="property-value" aria-labelledby="number-label"><g:fieldValue bean="${documentInstance}" field="number"/></span>
					
				</li>
				</g:if>

				<g:if test="${documentInstance?.type}">
				<li class="fieldcontain">
					<span id="type-label" class="property-label"><g:message code="document.type.label" default="Type" /></span>
					
						<span class="property-value" aria-labelledby="type-label"><g:link controller="documentType" action="show" id="${documentInstance?.type?.id}">${documentInstance?.type?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>

				<g:if test="${documentInstance?.date}">
				<li class="fieldcontain">
					<span id="date-label" class="property-label"><g:message code="document.date.label" default="Date" /></span>
					
						<span class="property-value" aria-labelledby="date-label"><g:formatDate date="${documentInstance?.date}" type="date" /></span>
					
				</li>
				</g:if>
				
				<g:if test="${documentInstance?.subject}">
				<li class="fieldcontain">
					<span id="subject-label" class="property-label"><g:message code="document.subject.label" default="Subject" /></span>
					
						<span class="property-value" aria-labelledby="subject-label"><g:link controller="documentSubject" action="show" id="${documentInstance?.subject?.id}">${documentInstance?.subject?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
			
	 			<g:if test="${documentInstance?.description}">
				<li class="fieldcontain">
					<span id="description-label" class="property-label"><g:message code="document.description.label" default="Description" /></span>
					
						<span class="property-value" aria-labelledby="description-label"><g:fieldValue bean="${documentInstance}" field="description"/></span>
					
				</li>
				</g:if>
				
				<g:if test="${documentInstance?.signer}">
				<li class="fieldcontain">
					<span id="signer-label" class="property-label"><g:message code="document.signer.label" default="Signer" /></span>
					
						<span class="property-value" aria-labelledby="signer-label"><g:fieldValue bean="${documentInstance}" field="signer"/></span>
					
				</li>
				</g:if>	
				
				<g:if test="${documentInstance?.signerType}">
				<li class="fieldcontain">
					<span id="signerType-label" class="property-label"><g:message code="document.signerType.label" default="Signer Type" /></span>
					
						<span class="property-value" aria-labelledby="signerType-label"><g:link controller="signerType" action="show" id="${documentInstance?.signerType?.id}">${documentInstance?.signerType?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
				
				<g:if test="${documentInstance?.sourceArea}">
				<li class="fieldcontain">
					<span id="sourceArea-label" class="property-label"><g:message code="document.sourceArea.label" default="Source Area" /></span>
					
						<span class="property-value" aria-labelledby="sourceArea-label"><g:link controller="area" action="show" id="${documentInstance?.sourceArea?.id}">${documentInstance?.sourceArea?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
				
				<g:if test="${documentInstance?.destinationArea}">
				<li class="fieldcontain">
					<span id="destinationArea-label" class="property-label"><g:message code="document.destinationArea.label" default="Destination Area" /></span>
					
						<span class="property-value" aria-labelledby="destinationArea-label"><g:link controller="area" action="show" id="${documentInstance?.destinationArea?.id}">${documentInstance?.destinationArea?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
			
				<g:if test="${documentInstance?.outbox}">
				<li class="fieldcontain">
					<span id="outbox-label" class="property-label"><g:message code="document.outbox.label" default="Outbox" /></span>
					
						<span class="property-value" aria-labelledby="outbox-label"><g:formatBoolean boolean="${documentInstance?.outbox}" /></span>
					
				</li>
				</g:if>
			
				<g:if test="${documentInstance?.state}">
				<li class="fieldcontain">
					<span id="state-label" class="property-label"><g:message code="document.state.label" default="State" /></span>
					
						<span class="property-value" aria-labelledby="state-label"><g:link controller="documentState" action="show" id="${documentInstance?.state?.id}">${documentInstance?.state?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
		
				<g:if test="${documentInstance?.transfer}">
				<li class="fieldcontain">
					<span id="transfer-label" class="property-label"><g:message code="document.transfer.label" default="Transfer" /></span>
					
						<span class="property-value" aria-labelledby="transfer-label"><g:link controller="transfer" action="show" id="${documentInstance?.transfer?.id}">${documentInstance?.transfer?.sendComment?.comment.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
			
				<g:if test="${documentInstance?.currentArea}">
				<li class="fieldcontain">
					<span id="currentArea-label" class="property-label"><g:message code="document.currentArea.label" default="Current Area" /></span>
					
						<span class="property-value" aria-labelledby="currentArea-label"><g:link controller="area" action="show" id="${documentInstance?.currentArea?.id}">${documentInstance?.currentArea?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
				
				<g:if test="${documentInstance?.modifiedDate}">
				<li class="fieldcontain">
					<span id="modifiedDate-label" class="property-label"><g:message code="document.modifiedDate.label" default="Modified Date" /></span>
					
						<span class="property-value" aria-labelledby="modifiedDate-label"><g:formatDate date="${documentInstance?.modifiedDate}" type="datetime" /></span>
					
				</li>
				</g:if>
			</ol>
			<g:form>
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${documentInstance?.id}" />
					<g:link class="create" controller="file" action="create" params="[documentId: documentInstance?.id]"><g:message code="document.addFile.label" default="Add File"/></g:link>
					<g:link class="show" controller="document" action="showLog" id="${documentInstance?.id}"><g:message code="default.show.label" args="[logEntityName]"/></g:link>
				</fieldset>
			</g:form>
			<g:render template="/file/documentFiles" model="['fileInstanceList': documentInstance?.files]"/>
		</div>
	</div>
	</body>
</html>
